<template>
  <div class="test_page">
    <Menus :title="title" :home="true" />
    <!-- <div class="testPage" v-if="!tip.show">
                                          <iframe id="iframeTest" :src='src' frameBorder=0 marginwidth=0 marginheight=0 scrolling=1 ALLOWTRANSPARENCY="true"></iframe>
                                        </div> -->
    <Tip @recall="tip.recall" :show="tip.show" :comfirmTitle="tip.comfirmTitle" :title="tip.title" style="margin-top:200px;">
      <div v-html="tip.detail"></div>
    </Tip>
  </div>
</template>
<script>
import Menus from '../components/Menu'
import Tip from '../components/Tip'
import { tipDetail } from '../config'
export default {
  data() {
    return {
      title: '',
      src: '',
      tip: {
        show: false,
        title: '温馨提示',
        recall: this.tipCall,
        detail: '',
        comfirmTitle: '确定'
      }
    }
  },
  components: {
    Menus,
    Tip
  },
  methods: {
    tipCall() {
      console.log(this.src)
      this.$router.push({ name: 'BindMobile', params: { url: this.src } })
      // this.tip.show = false
    }
  },
  async mounted() {
    const { id } = this.$route.params
    let point = localStorage.servicePoit
    const { title, tip, comfirmTitle } = this.$route.query
    this.title = title
    console.log(this.$route.query)

    if (!point) return
    let point_obj = JSON.parse(point)
    console.log(point_obj)
    if (point_obj.no) {
      this.src = `https://yn.12348.laway.cn/case/data_add1/${id}?title=${title}&no=${localStorage.code}`
      // this.src = `https://yn.12348.laway.cn/case/data_add1/${id}`
    }
    if (tip) {
      this.tip.show = true
      this.tip.title = tipDetail[id].title
      this.tip.detail = tipDetail[id].detail
      this.tip.comfirmTitle = comfirmTitle || '确定'
    } else {
      window.location.href = this.src
    }
  }
}
</script>

<style>
.testPage {
  height: 100vh;
  padding-top: 160px;
}
#iframeTest {
  height: 100%;
  width: 100%;
}
</style>

